package awt.awt02;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Dialog_01 {
    public static void main(String[] args){
        Frame fr=new Frame("Dialog_00");

        Dialog d1=new Dialog(fr,"模式对话框",true);


        d1.setBounds(100,100,300,300);

        Button b1=new Button("打开模式对话框");

        Box vBox=Box.createVerticalBox();
        vBox.add(new TextField(20));
        vBox.add(new Button("确认"));

        d1.add(vBox);

        b1.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e){
                d1.setVisible(true);
            }
        });



        fr.add(b1,BorderLayout.NORTH);


        fr.pack();
        fr.setVisible(true);
    }
}
